package com.lwx.sys.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author lwx
 * @since 2020-04-03
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Table(name = "sys_user")
@TableName("sys_user")
public class User implements Serializable {

    private static final long serialVersionUID=1L;

    @Id
    @TableId(value = "id", type = IdType.AUTO)
    @Column(name = "ID")
    private Integer id;

    @Column(name = "NAME")
    private String name;

    @Column(name = "LOGINNAME")
    private String loginname;

    @Column(name = "ADDRESS")
    private String address;

    @Column(name = "SEX")
    private Integer sex;

    @Column(name = "REMARK")
    private String remark;

    @Column(name = "PWD")
    private String pwd;

    @Column(name = "DEPTID")
    private Integer deptid;

    @Column(name = "HIREDATE")
    private Date hiredate;

    @Column(name = "MGR")
    private Integer mgr;

    @Column(name = "AVAILABLE")
    private Integer available;

    @Column(name = "ORDERNUM")
    private Integer ordernum;

    /**
     * 用户类型[0超级管理员1，管理员，2普通用户]
     */
    @Column(name = "TYPE")
    private Integer type;

    /**
     * 头像地址
     */
    @Column(name = "IMGPATH")
    private String imgpath;

    @Column(name = "SALT")
    private String salt;

    @Column(name = "DEPTNAME")
    @TableField(exist = false)//表示不会当成数据库表的字段，但是页面中有用
    private String deptname;

    @Column(name = "LEADERNAME")
    @TableField(exist = false)
    private String leadername;
}
